Complete pdp implementation#2
Complete pdp implementation#2anjor wants to merge 11 commits intodata-preservation-programs:masterfrom
Conversation
- Extract PDPVerifier ABI from synapse-sdk reference - Generate Go bindings using abigen for PDPVerifier contract - Add contract address constants for Mainnet and Calibration networks - Contract addresses: - Mainnet: 0xBADd0B92C1c71d02E7d520f64c0876538fa2557F - Calibration: 0x85e366Cf9DD2c0aE37E963d9556F5f4718d6417C This provides the foundation for implementing direct on-chain PDP operations including ProofSetManager.
- Add pkg/txutil package with transaction management utilities: - WaitForConfirmation: wait for transaction confirmations - EstimateGasWithBuffer: gas estimation with safety buffer - SendTransactionWithRetry: retry logic with exponential backoff - NonceManager: thread-safe nonce management - Retryable error detection and gas/nonce error handling - Implement ProofSetManager in pdp/manager.go: - CreateProofSet: create new proof sets on-chain - GetProofSet: retrieve proof set details - AddRoots: add piece CIDs to proof sets - GetRoots: retrieve pieces with pagination - DeleteProofSet: remove proof sets - GetNextChallengeEpoch: query challenge schedule - DataSetLive: check proof set status - Event parsing for DataSetCreated and PiecesAdded This completes the core PDP functionality for on-chain proof set management and integrates with PDPVerifier contract.
- Add comprehensive tests for retry logic functions - Test retryable error detection (nonce, gas, network errors) - Test backoff calculation with exponential growth - Test retry configuration defaults - Test error wrapping utilities - Test gas estimation validation - Fix format string in manager.go for network type All tests pass successfully.
- Add main README.md with: - Installation instructions - Quick start guide - API overview for all components - Configuration details - Contract addresses for Mainnet and Calibration - Development and testing instructions - Add create-proof-set example: - Complete working example of creating proof sets - Environment variable configuration - Optional piece addition - Example output and usage instructions - README with detailed setup steps The documentation provides clear guidance for users to get started with the go-synapse SDK for PDP operations.
- Add integration test suite with build tag - Test proof set lifecycle (create, query, check status) - Test contract connection and verification - Configure via environment variables: - CALIBRATION_RPC: RPC endpoint - TEST_PRIVATE_KEY: test wallet - TEST_LISTENER_ADDRESS: record keeper address Run with: go test -tags=integration -v ./... These tests verify end-to-end functionality against Calibration testnet including contract interactions and transaction confirmations.
Fixes staticcheck SA1012 linting error by using proper context instead of passing nil to EstimateGasWithBuffer in tests.
|
@lanzafame take a look again please? |
|
@anjor some claude generated pr comments, but I genuinely think those are issues that need addressing. |
|
Thanks @lanzafame! Pushed up fixes. |
parkan
left a comment
There was a problem hiding this comment.
overall looking pretty good, need to be more careful with error handling/looping
I'm not sure gas price discovery is ideal but we'll take it for now
|
presumably this is still a draft PR since we're missing major functionality, or is below out of scope? in storage: don't exist (totally makes sense to separate those form this layer but responding to the "complete" framing in title) |
|
the fixes look good to me, the only thing I would like to do before merging is maybe to stub out the signer interface with a dumb implementation that just takes pkey for now so the call signatures are stable (and we think through any problems with the proposed signer approach)/maybe work through the manager instantiation |
|
@parkan ready again |
There was a problem hiding this comment.
looks good to me, the simplification on nonce handling is much cleaner, signer interface can be extended for signing filecoin messages as needed (or separate iface could be defined, as desired)
overall I think this is ready to merge, the remaining plumbing should go in a separate PR
@lanzafame -- agreed? lmk if your concerns were addressed adequately/set review to approved and we'll merge
|
once merged I'll likely update the wallet-handler branch in singularity to pull in this signer interface/extend it for agent signing |
Completes the go-synapse library with full PDP (Proof of Data Possession) functionality, enabling integration with Singularity for f41 PDP deals.